package myJs.implicits

import scala.collection.immutable.SeqMap


trait MyMapTool {

  implicit class MyMap(map: Map[String, String]) {

    def reverse = {
      map.map { case (k, v) =>
        (v -> k)
      }
    }

  }

  implicit class MySeqMap(map: SeqMap[String, String]) {

    def keyList = {
      map.keys.toList
    }

  }

  implicit class MyMapVT[B](map: Map[String, B]) {

    def reverse = {
      map.map { case (k, v) =>
        (v -> k)
      }
    }

    def keyList = {
      map.keys.toList
    }

  }

  implicit class MySeqMapVT[B](map: SeqMap[String, B]) {

    def reverse = {
      map.map { case (k, v) =>
        (v -> k)
      }
    }

    def keyList = {
      map.keys.toList
    }

    def valueList = {
      map.values.toList
    }

  }



}
